// import java.util.Calendar;
#pragma once
#include <string>
#include <chrono>
#include "../../../utils/common_ptr.h"
// #include <boost/date_time/gregorian/gregorian.hpp>
// #include <boost/date_time/posix_time/posix_time.hpp>
// #include <boost/date_time/gregorian/greg_month.hpp>

class SQLIntervalUnit
{
public:
  static SQLIntervalUnit YEAR;
  static SQLIntervalUnit YEAR_MONTH;
  static SQLIntervalUnit QUARTER;
  static SQLIntervalUnit MONTH;
  static SQLIntervalUnit WEEK;
  static SQLIntervalUnit DAY;
  static SQLIntervalUnit DAY_HOUR;
  static SQLIntervalUnit DAY_MINUTE;
  static SQLIntervalUnit DAY_SECOND;
  static SQLIntervalUnit DAY_MICROSECOND;
  static SQLIntervalUnit HOUR;
  static SQLIntervalUnit HOUR_MINUTE;
  static SQLIntervalUnit HOUR_SECOND;
  static SQLIntervalUnit HOUR_MICROSECOND;
  static SQLIntervalUnit MINUTE;
  static SQLIntervalUnit MINUTE_SECOND;
  static SQLIntervalUnit MINUTE_MICROSECOND;
  static SQLIntervalUnit SECOND;
  static SQLIntervalUnit SECOND_MICROSECOND;
  static SQLIntervalUnit MICROSECOND;
  static SQLIntervalUnit DAY_OF_WEEK;
  static SQLIntervalUnit DOW;
  static SQLIntervalUnit DAY_OF_MONTH;
  static SQLIntervalUnit DAY_OF_YEAR;
  static SQLIntervalUnit YEAR_OF_WEEK;
  static SQLIntervalUnit YOW;
  static SQLIntervalUnit TIMEZONE_HOUR;
  static SQLIntervalUnit TIMEZONE_MINUTE;
  static SQLIntervalUnit DOY;
  static SQLIntervalUnit YEAR_TO_MONTH;

  string_ptr name;
  string_ptr nameLCase;
  uint64_t mask;

  SQLIntervalUnit(uint64_t mask, string_ptr name_);
  SQLIntervalUnit(SQLIntervalUnit *sqlIntervalUnit);
  SQLIntervalUnit();

  static BOOL_ptr add(std::chrono::system_clock::time_point &calendar, int intervalInt, SQLIntervalUnit unit);

  BOOL_ptr isDateTime();
  int hashCode();
  BOOL_ptr operator==(SQLIntervalUnit &rgt);

  static SQLIntervalUnit_ptr valueOf(string_ptr name);
};
